using System;

namespace FileMapper {
    public class Mapper {
        public ExtentList OldExtents { get; set; }
        public ExtentList NewExtents { get; set; }

        public Mapper() {}

        public long? MapPosition(long position) {
            return NewExtents.GetPhysicalPosition(OldExtents.GetLogicalPosition(position));
        }

        public ExtentList MapExtent(Extent extent) {
            return NewExtents.GetPhysicalExtents(OldExtents.GetLogicalExtents(extent));
        }
    }
}
